package com.hk.advice;

import org.aspectj.lang.annotation.*;

@Aspect
public class Audience {


    /**
     * 定义切点以重用
     */
    @Pointcut("execution(** com.hk.advice.Performance.perform(..))")
    public void perform(){

    }

    @Before("perform()")
    public void silenceCellPhones(){
        System.out.println("Before:Silencing cell phones");
    }


    @Before("perform()")
    public void  takeSeats(){
        System.out.println("Before:Taking seats");
    }

    @AfterReturning("perform()")
    public void applause(){
        System.out.println("AfterReturning:CLAP CLAP CLAP!!!");
    }



    @AfterThrowing("perform()")
    public void  demandRefund(){
        System.out.println("AfterThrowing:Demanding a refund");
    }



}
